#include <sys_head.h>

int main(int argc, char const *argv[])
{
    key_t key = ftok("home/student/桌面",1);
    int id = shmget(key,128,IPC_CREAT|0666);
    void *p = shmat(id,NULL,0);
    // char buf[128];
    // strcpy(buf,p);
    // printf("%s\n",buf);

    int *pInt = (int *)p;
    for (int i = 0; i < 10; i++)
    {
        printf("%d\n",pInt[i]);
    }
    

    shmdt(p);
    shmctl(id,IPC_RMID,NULL);
    return 0;
}
